package day03;

public class IFDemo {
    public static void main(String[] args) {
        System.out.println(isLeapYear(2012));

        System.out.println(getMaxDay(2012,2));
    }
    public static boolean isLeapYear(int year){
        return(year%400==0)||(year%4==0 && year%100!=0);
    }
    public static int getMaxDay(int year,int month){
        int max = -1;
        if(month==1 || month==3 || month==5||month==7||month==8||month==10||month==12)
            max = 31;
        else if(month==2){
            max = 28;
            max = isLeapYear(year)?29:28;
        }else{
            max =30;
        }
        return max;
    }
}
